<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.hbyj.util.ChangeTool"%>
<%@page import="com.hbyj.hbm.vo.MrBaseInf"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

MrBaseInf mbInfo = (MrBaseInf)request.getSession().getAttribute("SysUser");
String lyCode = mbInfo.getLyCode();

int flag = ChangeTool.ChangeArea(lyCode).length();
String shengName = "";String shiName = "";String xianName = "";
String shengCode = "";String shiCode = "00";String xianCode = "00";
if(flag==2){
	shengCode = lyCode;
	shengName = ChangeTool.getFinalValue(lyCode);
}else if(flag==4){
	shengCode = lyCode.substring(0,2)+"0000";
	shengName = ChangeTool.getFinalValue(shengCode);
	shiCode = lyCode.substring(0,4)+"00";
	shiName = ChangeTool.getFinalValue(shiCode);
}else if(flag==6){
	shengCode = lyCode.substring(0,2)+"0000";
	shengName = ChangeTool.getFinalValue(shengCode);
	shiCode = lyCode.substring(0,4)+"00";
	shiName = ChangeTool.getFinalValue(shiCode);
	xianCode = lyCode;
	xianName = ChangeTool.getFinalValue(xianCode);
}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'zbPersonManager.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="css/zbCss/pageTable.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="../../style/zbCss/defaultStyle.css" />
	<link rel="stylesheet" type="text/css" href="../../style/zbCss/easyui.css" />
	<link rel="stylesheet" type="text/css" href="../../style/zbCss/icon.css" />
	<link rel="stylesheet" type="text/css" href="../../style/zbCss/pageTable.css" />

	 <script type="text/javascript" src="../../lib/data.js"></script>
	  <script type="text/javascript" src="../../js/yjzsfunctiondlg/zbgl.js"></script>
	<script type="text/javascript" src="../../lib/easyui/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="../../lib/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../lib/easyui/json2.js"></script>
		<script type="text/javascript">
		$(function(){
			$('#detailsDialog').dialog({
				draggable : true,
				top : 50,
				left : 100,
				title : "值班人员详情",
				collapsible : true
			});
			initTable();
			$("#detailsDialog").dialog("close");
			setOption('china','shen');
			setOption('china','sheng');
			initTblZBRY();
			$("#queryBtn").bind('click',function(){return queryZBRYByKeyword()});
			var sort = '<%=flag%>';
			setSltDefaultVal("shen",<%=shengCode%>);
			setSltDefaultVal("sheng",<%=shengCode%>);
			$("#shen").attr("disabled","disabled");
			changeShenItem(document.getElementById("shen").value,'shi');
			changeShengItem(document.getElementById("sheng").value,'addshi');
			if(sort==4){//市级
				setSltDefaultVal("shi",<%=shiCode%>);
				changeShiItem(document.getElementById("shi").value,'xian');
				$("#shi").attr("disabled","disabled");
			}else if(sort==6){//县级
				setSltDefaultVal("shi",<%=shiCode%>);
				changeShiItem(document.getElementById("shi").value,'xian');
				setSltDefaultVal("xian",<%=xianCode%>);
				changeXianItem(document.getElementById("xian").value,'zhen');
				$("#shi").attr("disabled","disabled");
				$("#xian").attr("disabled","disabled");
			}
		})
		</script>

  </head>
  
  <body >
  <div id="wrapper">
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				style="margin-top: 0;">
				<tr>
					<td height="24" valign="middle" class="tab_title04">
						&nbsp;&nbsp;
						<img src="css/zbCss/images/icon_new.gif" width="16" height="16"
							align="middle" />
						&nbsp;&nbsp;值班人员管理
					</td>
				</tr>
			</table>
		<div id="tabsdiv" class="easyui-tabs">
				<div title="查询编辑" style="padding: 0px;" id="areaProject">
					省：<select id="shen" onchange="changeShenItem(this.value,'shi')"><option  selected="selected" value="" >请选择省</option></select>
					市：<select id="shi" onchange="changeShiItem(this.value,'xian')"><option  selected="selected" value="">请选择市</option></select>
					县：<select id="xian" onchange="changeXianItem(this.value,'zhen')"><option  selected="selected" value="">请选择县</option></select>
					姓名：<input id="qName" type="text">
					<input type="button" id="queryBtn" value="搜索" class="btn_2z"
										onclick="" />
					<input type="hidden" id="region" />
					<table id="tblZBRY" width="100%" height="400px"></table>
				</div>
				<div title="新增人员" style="padding: 0px; display: none;"
					id="projectAndF">
					
					<input type="hidden" id="addyjcz09000"/>
					<select style="display: none" id="sheng" onchange="changeShengItem(this.value,'addshi')"><option  selected="selected" value="" >请选择省</option></select>
					<table class="innerStyle" style="width:100%;">
	<br/>
	<tr><th colspan="4">新增值班人员</th></tr>
	<tr><td>值班单位</td><td><input type="text" id="addyjcz09020"/></td><td>值班人员</td><td><input type="text" id="addyjcz09030"/></td></tr>
	<tr><td>市级区划</td>
	<td><select id="addshi" 	onchange="changeShiItem(this.value,'addxian')">
	<option  selected="selected" value="-1">请选择市</option></select>
	<td>县级区划</td><td>
	<select id="addxian" onchange="changeXianItem(this.value,'zhen')">
	<option  selected="selected" value="-1">请选择县</option></select></td></tr>
	<tr><td>移动电话</td><td><input type="text" id="addyjcz09035"/></td><td>性别</td><td><input type="text" id="addyjcz09040"/></td></tr>
	<tr><td>办公电话</td><td><input type="text" id="addyjcz09050"/></td><td>办公传真</td><td><input type="text" id="addyjcz09060"/></td></tr>
	<tr><td>家庭电话</td><td><input type="text" id="addyjcz09070"/></td><td>邮编</td><td><input type="text" id="addyjcz09080"/></td></tr>
	<tr><td>通讯地址</td><td><input type="text" id="addyjcz09090"/></td><td>电子邮箱</td><td><input type="text" id="addyjcz09100"/></td></tr>
	<tr><td>值班人员职务</td><td><input type="text" id="addyjcz09110"/></td><td>备注</td><td><input type="text" id="addyjcz09120"/></td></tr>
	<tr id="btnTr">
	
	<td colspan="4" align="center"><input  type="button" value="保存" class="btn_2z"
					onclick="addNewZBRY()" />
					<input type="button" value="重置" class="btn_2z"
					onclick="resetEvent()" /></td></tr>
	</table>
				</div>
				
			</div>	
			</div>
	<div  id="detailsDialog" style="padding:5px;width:500px;height:300px;" >
	<input type="hidden" id="yjcz09000"/>
	<input type="hidden" id="yjcz09010"/>
	<table>
	
	<tr><td>值班单位</td><td><input type="text" id="yjcz09020"/></td><td>值班人员</td><td><input type="text" id="yjcz09030"/></td></tr>
	<tr><td>移动电话</td><td><input type="text" id="yjcz09035"/></td><td>性别</td><td><input type="text" id="yjcz09040"/></td></tr>
	<tr><td>办公电话</td><td><input type="text" id="yjcz09050"/></td><td>办公传真</td><td><input type="text" id="yjcz09060"/></td></tr>
	<tr><td>值班人员职务</td><td><input type="text" id="yjcz09110"/></td><td>邮编</td><td><input type="text" id="yjcz09080"/></td></tr>
	<tr><td>通讯地址</td><td><input type="text" id="yjcz09090"/></td><td>电子邮箱</td><td><input type="text" id="yjcz09100"/></td></tr>
	<tr><td >备注</td><td colspan="3"><input type="text" id="yjcz09120"/></td></tr>
	<tr id="btnTr">
	
	<td colspan="2" align="right"><input id="submitBtn"  type="button" value="保存" class="btn_2z"
					onclick="updateZBRY()" /></td>
					<td colspan="2"><input type="button" id="resetBtn" value="重置" class="btn_2z"
					onclick="resetEvent()" /></td></tr>
	</table>
	</div>
	</body>
</html>
